<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>AdminLTE 3 | Simple Tables</title>


    <!-- Font Awesome -->
    <link rel="stylesheet" href="/plugins/fontawesome-free/css/all.min.css">
    <!-- Theme style -->
    <link rel="stylesheet" href="/dist/css/adminlte.min.css">

    <link rel="stylesheet" href="/plugins/bootstraptable/bootstrap-table.min.css">

    <!-- Select2 -->
    <link rel="stylesheet" href="/plugins/select2/css/select2.min.css">
    <link rel="stylesheet" href="/plugins/select2-bootstrap4-theme/select2-bootstrap4.min.css">

</head>
<body class="hold-transition sidebar-mini">
<div class="wrapper">

    <div th:replace="fragment/header::header"></div>
<!--    menu start-->
    <div th:replace="fragment/menu::mainmenu(2)"></div>
<!--    menu end-->
    <!-- Content Wrapper. Contains page content -->
    <div class="content-wrapper">
        <!-- Content Header (Page header) -->
        <section class="content-header">
            <div class="container-fluid">
                <div class="row mb-2">
                    <div class="col-sm-6">
                        <h1>课程列表</h1>
                    </div>
                    <div class="col-sm-6">
                        <ol class="breadcrumb float-sm-right">
                            <li class="breadcrumb-item"><a href="#">Home</a></li>
                            <li class="breadcrumb-item active">课程列表</li>
                        </ol>
                    </div>
                </div>
            </div><!-- /.container-fluid -->
        </section>

        <!-- Main content -->
        <section class="content">
            <div class="container-fluid">

                <div class="row">

                    <div class="col-md-12">

                        <div class="card">
                            <div class="card-body">
                                <div class="btn-group">
                                    <button type="button" class="btn btn-default"
                                            data-toggle="modal" data-target="#myModal" onclick="addBefore();">新增
                                    </button>

                                    <button type="button" class="btn btn-danger" onclick="delrows();">删除</button>
                                </div>
                            </div>

                        </div>


                    </div>
                </div>


                <table class="table table-bordered" id="courseTable">

                </table>


            </div><!-- /.container-fluid -->
        </section>
        <!-- /.content -->
    </div>
    <!-- /.content-wrapper -->




    <div th:replace="fragment/footer::footer"></div>


    <div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
        <div class="modal-dialog">
            <div class="modal-content">
                <div class="modal-header">
                    <h4 class="modal-title">课程信息</h4>
                    <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                        <span aria-hidden="true">&times;</span>
                    </button>
                </div>

                <form role="form" method="post" id="courseForm">

                    <input type="hidden" id="id" name="id" value="-1"/>
                    <div class="modal-body">
                        <div class="box-body">

                            <div class="form-group">
                                <label for="courseName">课程名</label>
                                <input type="text" class="form-control" id="courseName" name="courseName"
                                       placeholder="请输入课程名" required minlength="2" maxlength="20">
                            </div>

                            <div class="form-group">
                                <label for="teacherId">教师：</label>

                                <select class="form-control select2bs4" style="width: 100%;" id="teacherId" name="teacherId">

                                </select>

                            </div>
                        </div>
                        <!-- /.box-body -->
                    </div>
                    <div class="modal-footer">

                        <a href="#" onclick="submitCourseForm();" class="btn btn-primary">提交更改</a>
                    </div>

                </form>
            </div><!-- /.modal-content -->
        </div><!-- /.modal -->
    </div>


</div>
<!-- ./wrapper -->

<!-- jQuery -->
<script src="/plugins/jquery/jquery.min.js"></script>
<!-- Bootstrap 4 -->
<script src="/plugins/bootstrap/js/bootstrap.bundle.min.js"></script>
<!-- AdminLTE App -->
<script src="/dist/js/adminlte.min.js"></script>
<script src="/plugins/bootstraptable/bootstrap-table.min.js"></script>


<script src="/plugins/bootstraptable/bootstrap-table-locale-all.min.js"></script>
<script src="/plugins/jquery-validation/jquery.validate.min.js"></script>
<script src="/plugins/jquery-validation/localization/messages_zh.min.js"></script>
<!-- Select2 -->
<script src="/plugins/select2/js/select2.full.min.js"></script>
<script src="/pages/course.js"></script>
</body>
</html>